<template>
	<view class="settlement">
		<radio color="#C00000" class="radio" :checked="isAll" @click="radioClickHandler"><text>全选</text></radio>
		<view class="amount-box">
			合计:<text class="amount">￥{{totalPrice}}</text>
		</view>
		<view class="btn-settle" @click="settlementClick">
			结算({{total}})
		</view>
	</view>
</template>
<script>

	export default {
		name: "settle",
		props:{
			//购物车商品商品数量
			total:"",
			//购物车中已勾选商品总价
			totalPrice:"",
			//是否全选
			isAll:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {

			};
		},
		methods:{
			radioClickHandler(){
				this.$emit('isCheckedAll')
			},
			settlementClick(){
				this.$emit('settlement')
			}
		}
	}
</script>
<style lang="less">
	.settlement {
		width: 100%;
		position:fixed;
		display: flex;
		justify-content: space-around;
		align-items: center;
		text-align: center;
		left: 0;
		//此处写法兼容小程序端
		bottom:  var(--window-top);;
		height: 50px;
		.amount{
			color: #C00000;
		}
		.btn-settle{
			color: #fff;
			height: 100%;
			display: flex;
			justify-content: center;
			align-items:center;
			background:#C00000;
			width: 250rpx;
		}
	}
</style>